<#import "/spring.ftl" as spring />
<form action="/addUser" method="post">
    姓名:<input type="text" name="userName" value="<#if user??>${user.userName!}</#if>">
       <#if user??>
         <@spring.bind "user.userName" />
        <span style="color: red"> <@spring.showErrors ""/>  </span>
     </#if>
    <br><br>
    密码:<input type="password" name="password" value="<#if user??>${user.password!}</#if>">
     <#if user??>
         <@spring.bind "user.password" />
        <span style="color: red"> <@spring.showErrors ""/>  </span>
     </#if>
    <br><br>
    生日:<input type="text" name="birthday" value="<#if user?? && user.birthday??>${user.birthday?string("yyyy-MM-dd")}</#if>">
     <#if user??>
         <@spring.bind "user.birthday" />
        <span style="color: red"> <@spring.showErrors ""/>  </span>
     </#if>
    <br><br>
    性别:
    <input type="radio" name="sex" value="1" <#if user??&&user.sex =1>checked</#if>>男
    <input type="radio" name="sex" value="0" <#if user??&&user.sex =0>checked</#if>>女

    <br><br>
    代码:
    <input type="checkbox" name="codeType" <#if user??&&user.codeType??&&user.codeType?contains('java')>checked="checked"</#if> value="java">Java
    <input type="checkbox" name="codeType" <#if user??&&user.codeType??&&user.codeType?contains('python')>checked="checked"</#if>value="python">python
    <input type="checkbox" name="codeType" <#if user??&&user.codeType??&&user.codeType?contains('javaScript')>checked="checked"</#if>value="javaScript">JavaScript
    <input type="checkbox" name="codeType" <#if user??&&user.codeType??&&user.codeType?contains('c++')>checked="checked"</#if> value="c++">c++
    <br><br>
    工作地:
    <#--注释-->
    <select name="address" >
        <option value="1" <#if user??&&user.address??&&user.address="1">selected="selected"</#if>>北京</option>
        <option value="2"<#if user??&&user.address??&&user.address="2">selected="selected"</#if>>上海</option>
        <option value="3"<#if user??&&user.address??&&user.address="3">selected="selected"</#if>>广州</option>
    </select>


    <br><br>
    爱好:<input type="text" name="hobby" value="<#if user??&&user.bobby??>${user.bobby!}</#if>">
    <br><br>
    文本域:<textarea name="" >

    </textarea>
    <input type="submit" value="添加用户">
</form>